package com.power.feign;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.power.domain.Category;
import com.power.domain.Prod;
import com.power.domain.ProdTagReference;
import com.power.feign.sentinel.SearchProdFeignSentinel;
import com.power.model.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Description 搜索服务调用商品模块的Feign接口
 * @Author dingchunlin
 * @Date 2024/07/21 16:55
 * @Version 1.0.0
 */
@FeignClient(value = "product-service",fallback = SearchProdFeignSentinel.class)
public interface SearchProdFeign {

    /**
     * 根据标签ID查询商品标签关联列表
     */
    @GetMapping("/prod/prodTag/getProdTagReferencePageByTagId")
    Result<Page<ProdTagReference>> getProdTagReferencePageByTagId(@RequestParam Long current,
                                                                   @RequestParam Long size,
                                                                   @RequestParam Long tagId);

    /**
     * 根据商品ID查询商品详情
     */
    @GetMapping("/prod/prod/getProdListById")
    Result<List<Prod>> getProdListByIds(@RequestParam List<Long> prodIdList);

    @GetMapping("/prod/category/getCategoryListByParentId")
    Result<List<Category>> getCategoryListByParentId(@RequestParam Long parentId);

    /**
     * 根据分类ID查询商品列表
     */
    @GetMapping("/prod/prod/getProdListByCategoryIdList")
    Result<List<Prod>> loadProdListByCategoryIdList(@RequestParam List<Long> categoryIdList);
}
